import type { Directive, DirectiveBinding } from 'vue';

// 定义VUE3指令，根据权限控制元素显示隐藏
const vLevelread: Directive = {
    mounted(el: HTMLElement, binding: DirectiveBinding<any>) {
        if (!binding?.value?.right) {
            if (el?.classList && !el.classList?.contains('asailevel')) {
                el.classList.add('asailevel');
            }
        }
    },
};

// 局部使用：
export default vLevelread;

// 全局使用示例：
// const directives = {
//   install: function (app: any) {
//     app.directive('move', vLevelread);
//   },
// };

// export default directives;
